﻿<%@ Page Language="C#" MasterPageFile="~/YUIAspNet.Master" AutoEventWireup="true" CodeBehind="DynamicMenu.aspx.cs" Inherits="YUIAspNetDemo.Menu.DynamicMenu" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>YUIAsp.Net Controls : LiveDemo : Menu : Dynamic Menu</title>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h4>Dynamic menu</h4>
    <p>The menu is created, but it's not visible until you click the "show menu" button. You can set the control to show the menu on click to any control on your page. Just give the Menu control the ClientID of the button, through the ToggleElementID property.</p>
    
    <p>Note that, in this example, using a ASP NET Button, you have to return false on the client click event, to prevent a postback.</p>
    
    <p style="width:180px">
        <yui:Menu ID="menu" MenuType="Dynamic" ShowCentered="false" runat="server">
        <Items>
            <yui:MenuItem Text="YUIAspNet Controls" Value="1">
                <Items>
                    <yui:MenuItem Text="Slider" Value="Slider"></yui:MenuItem>
                    <yui:MenuItem Text="ColorPicker" Value="ColorPicker"></yui:MenuItem>
                    <yui:MenuItem Text="Button" Value="Button">
                        <Items>
                            <yui:MenuItem Text="Regular button" Value="regular"></yui:MenuItem>
                            <yui:MenuItem Text="Menu button" Value="menu"></yui:MenuItem>
                            <yui:MenuItem Text="Split button" Value="split"></yui:MenuItem>
                            <yui:MenuItem Text="Checkbox button" Value="checkbox"></yui:MenuItem>
                        </Items>
                    </yui:MenuItem>
                </Items>
            </yui:MenuItem>
            <yui:MenuItem Text="AspNet Ajax Controls" Value="2"></yui:MenuItem>
        </Items>
        </yui:Menu>
        
        <asp:Button ID="btnShow" Text="show menu" OnClientClick="return false;" runat="server" />
    </p>
</asp:Content>
